<template>
  <el-card class="box-card">
    <div slot="header" class="clearfix">
      <span>更改用户姓名</span>
    </div>
    <el-form v-model="form" ref="refForm">
      <el-form-item :label="`用户姓名--${memberDetail.name}`" prop="name">
        <el-input v-model="form.name" placeholder="输入要修改的姓名"></el-input>
      </el-form-item>
      <div>
        <el-button type="primary" @click="editName">提交申请</el-button>
      </div>
    </el-form>
  </el-card>

</template>

<script>
  import { getMemberDetail } from '@/services/api/member'
  import {form} from '@/build'
  export default {
    name: "edit-name-card",
    mixins:[form],
    data(){
      return{
        memberDetail:{},
        form:{
          member_id: this.$store.state.member.member_id,
        }
      }
    },
    mounted(){
      this.bindGet(getMemberDetail,'memberDetail',{
        sendingData: 'form',
        format:(data)=>{
          return data.memberDetail
        }
      })
      this.getAll()
    },
    methods:{
      editName() {
        this.$store.commit(types.SHOW_APPLY_MODAL,{data:this.form,from:'editName'})
      }
    }

  }
</script>

<style scoped>
  .edit-input {
    padding-right: 100px;
  }

  .cancel-btn {
    position: absolute;
    right: 15px;
    top: 10px;
  }
</style>
